public without sharing class ExcelImportController {
    public String  html {get;set;}//
    public   List<Attachment> attL   ;
    public ExcelImportController() {
         attL = [select Id,body from Attachment where Id =:System.currentPageReference().getParameters().get('id')];

        if(attL.size() > 0){
           Blob s =  attL[0].body;
         setTableData(s.toString());
           //html = s.toString();
          //delete attL;
        }else{
          setTableData('[[]]');
        }

    }


    public void setTableData(String  contentStr){
       html = '';
        System.debug(contentStr);
        List<Object> datas = (List<Object> ) JSON.deserializeUntyped(contentStr);

        for (Object t : datas) {//表
            List<Object> table = (List<Object>)t;

             html += '<table border="1" cellpadding="0" cellspacing="0" >';

              for (Object row : table) {//行

                    List<Object> tr = (List<Object>)row ;
                         html += '<tr >'; 
                    for (Object  col: tr) {//单元格

                        Map<String,Object> td= (Map<String,Object>)col ;

                        html += '<td';
                        if(td.get('style')!= null  && td.get('style')!= '') html += ' style="' + String.valueOf(td.get('style'))+'"';
                        if(td.get('colspan') != null  && td.get('colspan')!= '') html += ' colspan="'+String.valueOf(td.get('colspan'))+'"';
                        if(td.get('rowspan') != null  && td.get('rowspan') != '') html += ' rowspan="' +String.valueOf(td.get('rowspan'))+'"';
                        html += ' >';
                        if(td.get('title') != null) html += td.get('title');

                     html += '</td>';

                }
                  html += '</tr >'; 


            }

            html += '</table >';

            html +='<br/>';


        }
       
    }
 






}